<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>
<body>
    <!--也是用v-bind绑定 -->
        <div id="app">
            
            <div :style="Dstyle"></div>
            <br>
            <div :style="DstyleArr"></div>
            <br>
            <!-- 可以和原生style共生 可以同时填写 -->
            <div :style="DstyleArr" style="border: 5px saddlebrown solid;"></div>
        </div>
        <script>
            Vue.config.productionTip = false
            const  vm = new Vue({
                el:'#app',
                data(){
                    return {
                        //基础样式(对象写法)
                        Dstyle:{
                            width:'100px',
                            height:'100px',
                            background:'red'
                        },
                        //基础样式(数组写法)
                        DstyleArr:[{

                            height:'100px',

                        },{
                            width:'100px',
                        },
                        {
                            background:"blue"
                        }
                    ]

                    }
                }
            })
        </script>
</body>
</html>